package com.cn.springcloudwechat.model.enumerate;

/**
 * @author: Administrator
 * @create: 2018/7/19 11:17
 */
public enum YmActivityState {
    /**
     * 活动暂未开始
     */
    NOTSTARTED(1,"未开始"),
    /**
     * 活动进行中
     */
    UNDERWAY(2,"进行中"),
    /**
     * 活动已结束
     */
    CLOSURE(3,"结束");

    private Integer key;
    private String value;

    public Integer getKey() {
        return key;
    }

    YmActivityState(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public YmActivityState setKey(Integer key) {
        this.key = key;
        return this;
    }

    public String getValue() {
        return value;
    }

    public YmActivityState setValue(String value) {
        this.value = value;
        return this;
    }

    public static YmActivityState  formId(Integer key){
        switch (key){
            case 1:
                return  NOTSTARTED;
            case 2:
                return  UNDERWAY;
            case 3:
                return  CLOSURE;
             default:
                 throw  new IllegalArgumentException();
        }
    }

}
